﻿using System;
using System.Collections.Generic;
using System.Text;
using XDesigner.ORM;

namespace XDesigner.AppFramework.DOM
{
    [ORMType("Table_Role")]
    public class AppRole
    {
        public AppRole()
        {
        }

        private int _RecordID = 0;
        [ORMKeyField()]
        public virtual int RecordID
        {
            get { return _RecordID; }
            set { _RecordID = value; }
        }

        private string _Name = null;

        public virtual string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        private string _Description = null;

        public virtual string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }

        private bool _Enabled = true;
        [System.ComponentModel.DefaultValue( true )]
        public virtual bool Enabled
        {
            get { return _Enabled; }
            set { _Enabled = value; }
        }

        private List<AppPermission> _Permissions = null;
        /// <summary>
        /// Permissions
        /// </summary>
        [ORMRelation( ORMRelationStyle.OneToManyWithKeyList )]
        [ORMDelay()]
        [ORMField("Permissions")]
        public virtual List<AppPermission> Permissions
        {
            get { return _Permissions; }
            set { _Permissions = value; }
        }
    }
}
